package com.onesports.intelligent.k12.polarlight.mapper.market;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.onesports.intelligent.k12.polarlight.annotation.DataPermission;
import com.onesports.intelligent.k12.polarlight.domain.dto.market.ProductCourseDetailsDTO;
import com.onesports.intelligent.k12.polarlight.domain.dto.market.ProductSelectDTO;
import com.onesports.intelligent.k12.polarlight.domain.dto.organization.CampusIdDTO;
import com.onesports.intelligent.k12.polarlight.domain.vo.product.*;

import java.util.List;

import com.onesports.intelligent.k12.polarlight.enums.DataPermissionJoinTypeEnum;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.onesports.intelligent.k12.polarlight.domain.entity.market.Product;
import org.apache.ibatis.annotations.Param;

/**
 * 商品表
 *
 * @author
 * @since 1.0.0 2022-07-08
 */
@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    /**
     * 模糊查询商品带分页
     *
     * @param page
     */

    @DataPermission(alias = "pcr", joinType = DataPermissionJoinTypeEnum.OUTER_JOIN)
    IPage<ProductSelectPageVO> findPage(
            Page<ProductSelectPageVO> page, @Param("dto") ProductSelectDTO dto);

    /**
     * 根据校区Id查询商品课程列表
     *
     * @param dto dto
     * @return {@link List}<{@link ProductCourseVO}>
     */
    List<ProductCourseVO> getProductCourseList(@Param("dto") CampusIdDTO dto);

    /**
     * 获取商品详情
     *
     * @param dto dto
     * @return {@link List}<{@link ProductCourseDetailsVO}>
     */
    ProductCourseDetailsVO getCourseDetails(@Param("dto") ProductCourseDetailsDTO dto);

    /**
     * 小程序端-获取商品列表
     */
    List<WxProductVO> findWxList();

    /**
     * 小程序端-用户评价
     *
     * @param productId
     */
    List<WxEvaluateVO> evaList(@Param("productId") String productId);

    /**
     * 机构端商品上架-修改数据
     *
     * @return
     */
    Integer updateSell(@Param("productId") String productId);
}
